<?php

namespace Addons\BLConn\Controller;

use Home\Controller\AddonsController;
use User\Api\UserApi;


class ScoreLogController extends AddonsController {
    // 通用插件的列表模型
    function _initialize() {
        parent::_initialize();

        $controller = strtolower ( _CONTROLLER );

        $res ['title'] = '会员管理';
        $res ['url'] = addons_url ( 'BLConn://BLConn/lists' );
        $res ['class'] = $controller == 'blconn' ? 'current' : '';
        $nav [] = $res;

        $res ['title'] = '积分总记录';
        $id = I('id');
        if(!empty($id)){
            $res ['title'] = '个人积分记录';
        }
        $res ['url'] = addons_url ( 'BLConn://ScoreLog/lists' );
        $res ['class'] = $controller == 'scorelog' ? 'current' : '';
        $nav [] = $res;

        $this->assign ( 'nav', $nav );
    }

    public function lists(){
        $this->assign ( 'add_button', false );
        $this->assign ( 'del_button', false );
        $this->assign ( 'check_all', false );
        $model = $this->getModel ( 'score_log' );

        $id = I('id');
        if(!empty($id)){
            session('common_condition', array('uid' => $id));
        }

        parent::common_lists ( $model );
    }

}
